<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              :row-style="{height:100+'px'}">
      <el-table-column prop=""
                       label="选择"
                       align="center">
        <input type="checkbox">
      </el-table-column>
      <el-table-column prop="gmtCreated"
                       label="提交问诊时间"
                       align="center">
      </el-table-column>
      <el-table-column prop="userId"
                       label="患者"
                       align="center">
      </el-table-column>
      <el-table-column prop="department"
                       label="科室"
                       align="center">
      </el-table-column>
      <el-table-column prop="doctorName"
                       label="医生"
                       align="center">
      </el-table-column>
      <el-table-column prop="interroSource"
                       label="方式"
                       align="center">
      </el-table-column>
      <el-table-column prop="interroWay"
                       label="来源"
                       align="center">
      </el-table-column>
      <el-table-column prop="order.etMoney"
                       label="问诊费"
                       align="center">
      </el-table-column>
      <el-table-column prop=""
                       label="订单状态"
                       align="center">
        <template slot-scope="scope">
          <font v-if="scope.row.order.orderStatus ==0">待支付</font>
          <font v-if="scope.row.order.orderStatus ==1">进行中</font>
          <font v-if="scope.row.order.orderStatus ==2">已完成</font>
          <font v-if="scope.row.order.orderStatus ==3">已取消</font>
        </template>

      </el-table-column>
      <el-table-column prop=""
                       label="操作"
                       align="center">
        <template slot-scope="scope">
          <!-- scope里面记录了当前行的下标，数据 -->
          <el-row>
            <el-col :span="8">
              <el-button type="success"
                         @click="info(scope)"
                         size="mini">查看下级</el-button>
            </el-col>
            <el-col :span="8">
              <el-button type="warning"
                         @click="update(scope)"
                         size="mini">编辑</el-button>
            </el-col>
            <el-col :span="8">
              <el-button type="danger"
                         @click="del(scope)"
                         size="mini">删除</el-button>
            </el-col>
          </el-row>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "DepartmentsData",
  //接收父组件传递的数据
  props: {
    tableData: Array
  },
  methods: {
    info: function (scope) {
      this.$router.push({ name: 'PrescriptionDetail', query: { num: scope.row.num } })
    },
    update: function (scope) {

    },
    del: function (scope) {
      alert("删除")
    }
  }
}
</script>

<style scoped>
</style>
